﻿// Copyright © Microsoft Corporation.  All Rights Reserved.
// This code released under the terms of the 
// Microsoft Public License (MS-PL, http://opensource.org/licenses/ms-pl.html.)

using System.ComponentModel;
using System.Windows;

namespace TheOliver.Controls
{
    public class ShowMessageBoxAction : 
        System.Windows.Interactivity.TargetedTriggerAction<FrameworkElement>
    {
        #region Property to Expose
        [Category("Message Box Properties")]

        public string MessageBoxText
        {
            get { return (string)GetValue(MessageBoxTextProperty); }
            set { SetValue(MessageBoxTextProperty, value); }
        }

        public static readonly DependencyProperty MessageBoxTextProperty 
            = DependencyProperty.Register("Storyboard Name", 
            typeof(string), 
            typeof(ShowMessageBoxAction), 
            new PropertyMetadata("Message"));

        #endregion

        protected override void Invoke(object o)
        {
            MessageBox.Show(MessageBoxText);
        }
    }
}
